package cn.yunhe.daoImpl;

import java.util.List;

import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import cn.yunhe.dao.AccountDao;
import cn.yunhe.entity.Account;

public class AccountDaoImpl extends HibernateDaoSupport implements AccountDao {

	public Account get(int accountId) {
		
		return super.getHibernateTemplate().get(Account.class, accountId);
	}

	public void addAccount(Account account) {
		super.getHibernateTemplate().save(account);
		
	}

	public void delAccount(int accountId) {
		
		super.getHibernateTemplate().delete(this.get(accountId));
	}

	public void updateAccount(Account account) {
		super.getHibernateTemplate().update(account);
		
	}

	public List<Account> findAllAccount(String hql) {
		
		return super.getHibernateTemplate().find(hql);
	}

}
